<script lang="ts" setup>
import { useVbenModal } from '@vben/common-ui';

import { useVbenForm } from '#/adapter/form';

import { useSchema } from './data';

const [Form] = useVbenForm({
  wrapperClass: 'grid grid-cols-12',
  commonConfig: {
    // 所有表单项
    componentProps: {
      class: 'w-full',
    },
  },
  layout: 'horizontal',
  schema: useSchema(),
  showDefaultActions: false,
});

const [Modal] = useVbenModal({
  class: 'w-[800px]',
  closeOnClickModal: false,
  async onConfirm() {},
  onOpenChange(isOpen) {
    if (isOpen) {
      console.warn('打开');
    }
  },
});

// function resetForm() {
//   formApi.resetForm();
//   formApi.setValues({});
// }
</script>

<template>
  <Modal>
    <Form class="mx-4" />
  </Modal>
</template>
